View Javadoc
1 package junit.quilt.framework; 2 3 /*** 4 * ProgramAdapter 5 * 6 * This is an action which is useful 7 * for kicking off a program. 8 * 9 * It will change ClassLoaders and 10 * everything. . . 11 */ 12 13 import junit.quilt.ui.ResourceAction; 14 15 import java.awt.event.ActionEvent; 16 17 import java.util.ResourceBundle; 18 import java.util.Enumeration; 19 20 public abstract class ProgramAdapter 21 extends ResourceAction 22 implements Runnable 23 { 24 private Thread runner = null; 25 private ActionEvent event = null; 26 27 public ProgramAdapter( String resources ) 28 { 29 super( resources ); 30 } 31 32 public abstract void go(); 33 34 public void setEvent( ActionEvent event ) { 35 this.event = event; 36 } 37 38 public ActionEvent getEvent() { 39 return this.event; 40 } 41 42 public void run() { 43 setEnabled( false ); 44 go( ); 45 setEnabled( true ); 46 } 47 48 public void actionPerformed( ActionEvent event ) { 49 setEvent( event ); 50 runner = new Thread( this ); 51 runner.start(); 52 } 53 } 54 55 56

This page was automatically generated by Maven